set _passed = @filereq( "Please select the file(s)" $MagicDir"#?" $MagicFile )
set MagicRep true
else
set MagicRep false
endif
if -n $_passed = ""
set MagicDir @dirname( ""$_passed"" )/
set MagicFile @basename( ""$_passed"" )
if $MagicDir = "/"
tackon _passed $_cwd $_passed
set MagicDir $_cwd
endif
if $MagicDir = ":/"
tackon _passed $_cwd $_passed
set MagicDir $_cwd
endif
ReqAsk "Would you like me to:*nView the file,*nExtract it to Current Directory*nor Extract it to elsewhere" TITLE "MagicExtract Requester" GADFMT "Extract|View|Elsewhere|Forget it!" GLOBAL
if $ReqAskResult = 1
xtr $_passed
ReqAsk "OK, Finished extracting*nfile to Current Directory" TITLE "Press RETURN or ESC to continue" GADFMT "Bye" GLOBAL
endif
if $ReqAskResult = 2
v $_passed >T:MagicExtract.tmp
more T:MagicExtract.tmp
rm T:MagicExtract.tmp
endif
if $ReqAskResult = 3
set MagicExt @filereq( "Please select the destination directory" $MagicExt/ )
cd $MagicExt
xtr $_passed
ReqAsk "OK, Finished extracting*nfile to elsewhere" TITLE "Press RETURN or ESC to continue" GADFMT "Bye" GLOBAL
endif
if $MagicRep = true
setenv ReqAskResult 0
goto request
endif
endif
label end
setenv ReqAskResult 0
return
# Thanks to Magnus Holmgren for creating the wonderful
# ReqChange, and ReqAsk,
# and to Nico François for his superb ReqTools library,
# and of course lets not forget Stefan Boberg.
# And to Stefan Becker for ToolManager.
# And to the guy who wrote UnLha who inspired this
# little script. (sorry I couldn't see your name anywhere)
# And of course to the following for CShell:
# Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
# Shell V2.04M-V2.07M by Steve Drew
# Shell V2.08MI, V3.xxA and V4.xxA by Carlo Borreo & Cesare Dieni